import { Injectable } from "@angular/core";
import {
  animate,
  AnimationTriggerMetadata,
  style,
  transition,
  trigger
} from "@angular/animations";

@Injectable({
  providedIn: "root"
})
export class EhAnimateService {
  constructor() {}

  static fadeInOut(): AnimationTriggerMetadata {
    return trigger("fadeInOut", [
      transition(":enter", [
        style({ opacity: 0 }),
        animate(500, style({ opacity: 1 }))
      ]),
      transition(":leave", [animate(500, style({ opacity: 0 }))])
    ]);
  }
}
